/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.fiap.view;

import br.com.fiap.model.DadosSAC;
import br.com.fiap.model.Entidade;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author rm64596
 */

@WebServlet(urlPatterns="/RelatorioReclamacao")
public class RelatorioReclamacao extends HttpServlet{

    
    private List<Entidade> reclamacao;
     private PrintWriter writer;
     private List<Entidade> x;
    
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        
        
        reclamacao = (List<Entidade>) req.getAttribute("modelo");
        
        writer = resp.getWriter(); 
        
        String HTML = "<HTML><BODY>";
        
        for(Entidade tmp : reclamacao)
        { 
           
        HTML+= "<table>"
                + "<row>"+tmp.getId()+"</row>"
                + "   "
                + "<row>"+tmp.getNome()+"</row>"
                +"</table>";
        }
        
        HTML += "</BODY></HTML>";
        
        
        resp.getWriter().write(HTML);
                
        
    }
   
}
